import filterMap from "./filterMap.js";
import utils from "@/utils/utils.js";

export default {
	scoreTypeFlt: value => {
		if (!value) return ""
		return filterMap.scoreTypeFlt[value]
	},
	platformFlt: value => {
		const tem = filterMap.platformMap.find(item => item.value == value)
		return tem && tem.text
	},
	distanceFlt: (latlng1, latlng2) => {
		// console.log("distanceFlt==",latlng1, latlng2)
		return utils.getDistance(latlng1, latlng2)
	},
	statusFlt: value => {
		return filterMap.statusMap[value]
	},
	filterTime: value => {
		let time = new Date(value.replaceAll('-', '/')).getTime()
		return utils.formatDate(new Date(time))
	},
	dataTypeFlt: value => {
		const tem = filterMap.dataTypeMap.find(item => item.value == value)
		return tem && tem.label
	},
}
